Skip to content

Conversation

@paulp
Copy link
Contributor

@paulp paulp commented Nov 19, 2012

Incorporating knowledge of what failed on the first attempt. The list of failures probably looked like a lot more than it was; only five methods were implicated, but some were called a lot. This PR restores those methods and marks them as externally used until we have a more permanent mechanism for assuring their survival.

Review by @dotta (confirmation that everything builds against this would be very helpful.)

paulp added 14 commits November 19, 2012 11:52
I want to get this commit into the history because
the tests pass here, which demonstrates that every commented
out method is not only unnecessary internally but has zero
test coverage. Since I know (based on the occasional source
code comment, or more often based on knowing something about
other source bases) that some of these can't be removed
without breaking other things, I want to at least record
a snapshot of the identities of all these unused and
untested methods.

This commit will be reverted; then there will be another
commit which removes the subset of these methods which I
believe to be removable. The remainder are in great need of
tests which exercise the interfaces upon which other
repositories depend.
Translating <code></code> into backticks.

Removed the "@param tree ..." blocks which have been
taunting me for half a decade now.

Removed commented-out blocks of code which had been
sitting there for two years or more.
And small associated changes.
There were a whole lot of these.
Mostly hailing from a long-ago day when I imagined I was
writing a general purpose library. We dodged that bullet.
It has accreted its share through the bumpy years.
@paulp paulp mentioned this pull request Nov 19, 2012
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional or just an oversight?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Is that a donkey or a baseball?"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

@scala-jenkins
Copy link

Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/1691/

@scala-jenkins
Copy link

jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/1691/

@scala-jenkins
Copy link

Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/981/

@scala-jenkins
Copy link

jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/981/

@dotta
Copy link
Contributor

dotta commented Nov 20, 2012

Paul, two Sbt modules that we bundle in the IDE for incremental compilation do not compile anymore. Sorry for the trouble, yesterday I must have messed up something when locally publishing the Scala artifacts.

Here is the error (it is the same for both Sbt modules: compile and compiler-interface):

[error] /Users/mirco/Projects/ide/uber-build/xsbt/compile/Eval.scala:119: value scalaAnyRefConstr is not a member of object Eval.this.global.gen
[error] def moduleBody = Template(List(gen.scalaAnyRefConstr), emptyValDef, List(emptyInit, method))
[error] ^
[error] one error found

Then, while scala-refactoring now compiles fine, there are a number of failing tests (which runs just fine with the last deployed 2.11.0-SNAPSHOT). Maybe we should ask for Mirko (@misto) feedback.

Failed tests:
findReferencesToLocal(scala.tools.refactoring.tests.analysis.DeclarationIndexTest)
findClassDeclarationToMethodParameter(scala.tools.refactoring.tests.analysis.DeclarationIndexTest)
findClassDeclarationFromMethodParameter(scala.tools.refactoring.tests.analysis.DeclarationIndexTest)
referencesToLazyVal211(scala.tools.refactoring.tests.analysis.DeclarationIndexTest)
referencesToTypesInAppliedTypes(scala.tools.refactoring.tests.analysis.DeclarationIndexTest)
findReferencesToMethod(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
findReferencesToClass(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
findReferencesToTraitMethod(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
findInImports(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
overriddenMethods(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
overriddenMethods2(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
overriddenMethods3(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
overriddenMethods4(scala.tools.refactoring.tests.analysis.MultipleFilesIndexTest)
methodNameCollision(scala.tools.refactoring.tests.analysis.NameValidationTest)
simpleUnusedType(scala.tools.refactoring.tests.implementations.imports.UnusedImportsFinderTest)
typeIsUsedAsVal(scala.tools.refactoring.tests.implementations.imports.UnusedImportsFinderTest)
typeIsImportedFrom(scala.tools.refactoring.tests.implementations.imports.UnusedImportsFinderTest)
wildcardImports(scala.tools.refactoring.tests.implementations.imports.UnusedImportsFinderTest)
wildcardImportsFromValsAreIgnored(scala.tools.refactoring.tests.implementations.imports.UnusedImportsFinderTest)
markImportedOccurrences(scala.tools.refactoring.tests.implementations.MarkOccurrencesTest)
markImportedAndRenamedOccurrences(scala.tools.refactoring.tests.implementations.MarkOccurrencesTest)
markImportedAndRenamedOccurrencesRenamedSelected(scala.tools.refactoring.tests.implementations.MarkOccurrencesTest)

Tests run: 874, Failures: 22, Errors: 0, Skipped: 15

Finally, there is a new error in the IDE side:

[ERROR] /Users/mirco/Projects/ide/uber-build/scala-ide/org.scala-ide.sdt.debug.tests/src/scala/tools/eclipse/debug/classfile/ClassfileParser.scala:76: error: value nextBytes is not a member of scala.tools.nsc.symtab.classfile.AbstractFileReader
[ERROR] bytecode = reader.nextBytes(codeLen)

@misto
Copy link

misto commented Nov 20, 2012

@dotta can you send me the detailed error reports of the failures?

@dotta
Copy link
Contributor

dotta commented Nov 20, 2012

@misto
Copy link

misto commented Nov 20, 2012

Ok, it seems all the failures have the same cause: "Race condition detected: You are running a presentation compiler method outside the PC thread." Should be easy to fix!

@dotta
Copy link
Contributor

dotta commented Nov 20, 2012

Oh, I see, thanks Mirko for looking into it! And, I just noticed that our nightly for scala-refactoring against 2.11.0-SNAPSHOT is not running tests. That explains why I did not see the failing tests before.

Bottom line, I believe we can ignore the failing tests in scala-refactoring, as they are not related to this PR. If we can sort out the two remaining compilation errors, you'll have my 👍 ;-)

Not a bad showing for a newcomer. Of course most of this
code predates scala.reflect by a lot.
Removing code from this neighborhood is more difficult than
elsewhere, making it all the more important that it be done.
Nobody is immune!
      They are everywhere.
    They defy categorization.
      They are... M I S C
All those old-timey methods whose melodies have become
unfashionable.
@paulp
Copy link
Contributor Author

paulp commented Nov 20, 2012

If I understood which errors were legit and which weren't, the push I just did should get everything compiling.

@paulp
Copy link
Contributor Author

paulp commented Nov 20, 2012

PLS REBUILD ALL

@scala-jenkins
Copy link

Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/1695/

@scala-jenkins
Copy link

jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/1695/

@scala-jenkins
Copy link

Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/985/

@scala-jenkins
Copy link

jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/985/

@dotta
Copy link
Contributor

dotta commented Nov 21, 2012

If I understood which errors were legit and which weren't, the push I just did should get everything compiling.

Yes, now it's all good from the IDE side.

@adriaanm
Copy link
Contributor

sure sounds like an LGTM to me! excellent work, gang!

adriaanm added a commit that referenced this pull request Nov 21, 2012
@adriaanm adriaanm merged commit 1cfb363 into scala:master Nov 21, 2012
@adriaanm
Copy link
Contributor

so long, lines of code!

@retronym
Copy link
Member

Surely as a reward @paulp gets the honour of driving the stake through patmat classico on master.

@adriaanm
Copy link
Contributor

that, and a complimentary cappuccino

dwijnand added a commit to dwijnand/zinc that referenced this pull request Jul 31, 2017
Follow-up on sbt#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
dwijnand added a commit to dwijnand/zinc that referenced this pull request Aug 14, 2017
Follow-up on sbt#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
dwijnand added a commit to dwijnand/zinc that referenced this pull request Sep 5, 2017
Follow-up on sbt#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
eed3si9n pushed a commit to eed3si9n/scala that referenced this pull request May 14, 2019
Follow-up on scala#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
lrytz pushed a commit to lrytz/scala that referenced this pull request Nov 5, 2019
Follow-up on scala#314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.

Rewritten from sbt/zinc@33d2e68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants